//
//  FSCodeDefine.h
//  rui_lian_zhi_jia
//
//  Created by 代佳宏 on 2019/9/24.
//  Copyright © 2019 华宇瑞联. All rights reserved.
//

#ifndef FSCodeDefine_h
#define FSCodeDefine_h


//服务器地址
#ifdef DEBUG

//开发
#define SERVER1 @"http://api.dev.cheyizhuan.com:8008"//开发环境api地址:
#define SERVERWEB1 @"http://h5.union.dev.cheyizhuan.com:7008"//H5开发地址

//测试
#define SERVER @"http://api.int.cheyizhuan.com"//测试环境api 地址
#define SERVERWEB @"http://h5.union.int.cheyizhuan.com:7000"//H5测试地址

//预发布
#define SERVER3 @"http://api.staging.cheyizhuan.com:30080"//预发布环境api地址:
#define SERVERWEB3 @"http://h5.union.staging.cheyizhuan.com"//H5预发布

//Daily环境
#define SERVER5 @"http://api.daily.cheyizhuan.com:50080"//Daily环境api地址:
#define SERVERWEB5 @"http://h5.union.daily.cheyizhuan.com"//H5Daily

//正式
#define SERVER4 @"https://api.cheyizhuan.com"//
#define SERVERWEB4 @"http://h5.union.cheyizhuan.com"//H5正式地址


#pragma mark - 开发测试api
/*                   *                          */
//#define API_EMP_URL                  @"/mock/105"
//#define API_ORDER_URL                @"/mock/78"
//#define API_EQUIPMENT_URL            @"/mock/84"
//#define API_CUSTOMER_PATH            @"/mock/40"
//#define API_OTH_URL                  @"/mock/87"
//#define API_MSHPCARD_URL             @"/mock/72"
//#define API_DEPOT_URL                @"/mock/66"
//#define API_CAR_URL                  @"/mock/81"
//#define API_CUSTOMER_PATH               @"/mock/90"
//#define API_PRODUCT_URL              @"/mock/100"



#pragma mark - 手机测试pi

#define API_EMP_URL                  @"/employee/v1"
#define API_ORDER_URL                @"/order/v2"
#define API_EQUIPMENT_URL            @"/equipment/v1"
#define API_CUSTOMER_PATH            @"/customer/v1"
#define API_OTH_PATH                 @"/otherac/v1"
#define API_MSHPCARD_URL             @"/mshpcard/v1"
#define API_DEPOT_URL                @"/depot/v1"
#define API_CAR_URL                  @"/car/v1"
#define API_PRODUCT_URL              @"/product/v1"
#define API_FINANCE_PATH             @"/finance/v1"
#define API_FS_CHECK_OPEN           @"/checkcar/v1"
#define API_OFFICAL_PATH             @"/OfficialAccount/v1"
#define API_INQUIRYL_URL             @"/inquiry/v1"
#define API_LOYALTYCARD_PATH         @"/loyaltyCard/v1"
#define API_SUPPLIER_URL             @"/supplier/v1"
#define API_PUSH_URL                 @"/push/v1"

#define API_OTH_URL(url)        [NSString stringWithFormat:@"%@%@",API_OTH_PATH,url]
#define API_FINANCE_URL(url)    [NSString stringWithFormat:@"%@%@",API_FINANCE_PATH,url]
#define API_CUSTOMER_URL(url)   [NSString stringWithFormat:@"%@%@",API_CUSTOMER_PATH,url]
#define TJQ_PRODUCT_URL(url)    [NSString stringWithFormat:@"%@%@",API_PRODUCT_URL,url]
#define TJQ_DEPOT_URL(url)      [NSString stringWithFormat:@"%@%@",API_DEPOT_URL,url]
#define WJW_ORDER_URL(url)      [NSString stringWithFormat:@"%@%@",API_ORDER_URL,url]
#define WJW_VIP_URL(url)        [NSString stringWithFormat:@"%@%@",API_MSHPCARD_URL,url]
#define HQ_ROLE_URL(url)        [NSString stringWithFormat:@"%@%@",API_EMP_URL,url]
#define API_CHECKCAR_URL(url)   [NSString stringWithFormat:@"%@%@",API_FS_CHECK_OPEN,url]
#define API_OFFICAL_URL(url)    [NSString stringWithFormat:@"%@%@",API_OFFICAL_PATH,url]
#define API_LOYALTYCARD_URL(url)   [NSString stringWithFormat:@"%@%@",API_LOYALTYCARD_PATH,url]

#else//正式环境

#define SERVER @"http://api.cheyizhuan.com"//
#define SERVERWEB @"http://h5.union.cheyizhuan.com"//H5正式地址

#define API_EMP_URL                  @"/employee/v1"
#define API_ORDER_URL                @"/order/v2"
#define API_EQUIPMENT_URL            @"/equipment/v1"
#define API_CUSTOMER_PATH            @"/customer/v1"
#define API_OTH_PATH                 @"/otherac/v1"
#define API_MSHPCARD_URL             @"/mshpcard/v1"
#define API_DEPOT_URL                @"/depot/v1"
#define API_CAR_URL                  @"/car/v1"
#define API_PRODUCT_URL              @"/product/v1"
#define API_FINANCE_PATH             @"/finance/v1"
#define API_FS_CHECK_OPEN           @"/checkcar/v1"
#define API_OFFICAL_PATH             @"/OfficialAccount/v1"
#define API_INQUIRYL_URL             @"/inquiry/v1"
#define API_LOYALTYCARD_PATH         @"/loyaltyCard/v1"
#define API_SUPPLIER_URL             @"/supplier/v1"
#define API_PUSH_URL                 @"/push/v1"


#define API_OTH_URL(url)        [NSString stringWithFormat:@"%@%@",API_OTH_PATH,url]
#define API_FINANCE_URL(url)    [NSString stringWithFormat:@"%@%@",API_FINANCE_PATH,url]
#define API_CUSTOMER_URL(url)   [NSString stringWithFormat:@"%@%@",API_CUSTOMER_PATH,url]
#define TJQ_PRODUCT_URL(url)    [NSString stringWithFormat:@"%@%@",API_PRODUCT_URL,url]
#define TJQ_DEPOT_URL(url)      [NSString stringWithFormat:@"%@%@",API_DEPOT_URL,url]
#define WJW_ORDER_URL(url)      [NSString stringWithFormat:@"%@%@",API_ORDER_URL,url]
#define WJW_VIP_URL(url)        [NSString stringWithFormat:@"%@%@",API_MSHPCARD_URL,url]
#define HQ_ROLE_URL(url)        [NSString stringWithFormat:@"%@%@",API_EMP_URL,url]
#define API_CHECKCAR_URL(url)   [NSString stringWithFormat:@"%@%@",API_FS_CHECK_OPEN,url]
#define API_OFFICAL_URL(url)    [NSString stringWithFormat:@"%@%@",API_OFFICAL_PATH,url]
#define API_LOYALTYCARD_URL(url)   [NSString stringWithFormat:@"%@%@",API_LOYALTYCARD_PATH,url]

#endif


#define YBH_DEV_CODE @"5OIQ6YO95BIC5YU"
/// 商品最高单价
#define FS_MAX_PRICE  999999900
/// 商品可选最大数量
#define FS_MAX_COUNT  99

#define KEY_FS_CONFIG @"KEY_FS_CONFIG"

#ifdef DEBUG
#define KSLog(format, ...) printf("class: <%p %s:(%d) > method: %s \n%s\n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, __PRETTY_FUNCTION__, [[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String] )
#else
#define KSLog(format, ...)
#endif


#define UIColorFromRGB(rgbValue)    [UIColor colorWithRed:((float)(((rgbValue) & 0xFF0000) >> 16))/255.0 \
green:((float)(((rgbValue) & 0x00FF00) >> 8))/255.0 \
blue:((float)((rgbValue) & 0x0000FF))/255.0 \
alpha:1.0]

#define RGB(r, g, b)        [UIColor colorWithRed:(r)/255.f green:(g)/255.f blue:(b)/255.f alpha:1.f]
#define RGBA(r, g, b, a)    [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]

#define iPhone_Height       [[UIScreen mainScreen ] bounds ].size.height
#define iPhone_Width        [[UIScreen mainScreen ] bounds ].size.width
#define iPhone_NavigationBar_Height [[UIApplication sharedApplication] statusBarFrame].size.height + 44 + 1

#define COLOR_WHITE [UIColor whiteColor]

//TABBAR字体颜色
#define COLOR_TABBAR_TINT UIColorFromRGB(0x999999)
#define COLOR_TABBAR_TINT1 UIColorFromRGB(0x029CE2)

//*******************字体定义********************//
#define Biz_DEFAULT_REGULAR_FONT_NAME   @"PingFangSC-Regular"
#define Biz_DEFAULT_MEDIUM_FONT_NAME   @"PingFangSC-Medium"

//Window主题颜色
#define COLOR_WINDOW_THEME [UIColor colorWithRed:90.0/255 green:174.0/255 blue:242.0/255 alpha:1.0]
//导航栏颜色
#define COLOR_NavigationBar_VIEW_BG [UIColor colorWithRed:245.0/255 green:245.0/255 blue:245.0/255 alpha:1.0]

///URL
#define URL(STRING)      [NSURL URLWithString:STRING]
///IMG
#define IMG(IMGSTR)      [UIImage imageNamed:IMGSTR]
///a为空则用b
#define YFStrOrLater(a,b)   (((a) && ([a length] > 0)) ? (a) : (b))


#define BASE_BLUE_IMAGE_8           [[UIImage imageNamed:@"baseRectangle8"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch]
#define BASE_BLUE_IMAGE_4           [[UIImage imageNamed:@"baseRectangle4"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch]
#define BASE_BOX_IMAGE_8            [[UIImage imageNamed:@"baseBox8"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch]
#define BASE_BOX_IMAGE_4            [[UIImage imageNamed:@"baseBox4"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch]
#define BASE_BOX_BLACK_IMAGE_8      [[UIImage imageNamed:@"baseBlackBox8"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch]
#define BASE_SHADOW_IMAGE_8         [[UIImage imageNamed:@"baseShadow8"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch]
#define BASE_SHADOW_IMAGE_0         [[UIImage imageNamed:@"baseShadow0"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch]
#define BASE_WHITE_TOP_8            [[UIImage imageNamed:@"baseWhiteTop8"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch]
#define BASE_WHITE_BOTTOM_8         [[UIImage imageNamed:@"baseWhiteBottom8"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch]
#define BASE_WHITE_IMAGE_8          [[UIImage imageNamed:@"baseWhiteRectangle8"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch]
#define BASE_GRAY_IMAGE_8           [[UIImage imageNamed:@"baseGrayRectangle8"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10) resizingMode:UIImageResizingModeStretch]



#define MyAppDelegate   ((AppDelegate *)[UIApplication sharedApplication].delegate)
#define MyApplication   [UIApplication sharedApplication]
#define MyAppWindow     [UIApplication sharedApplication].delegate.window

#define IPHONE8_WIDTH(width)    iPhone_Width / 375.0 * width
#define IS_IPHONE_X             (iPhone_Height >= 812.0)

#endif
